package com.hoas.api.core.exception;

import  com.hoas.api.core.entity.ErrorMessage;

public class BusinessException extends Exception {

	private static final long serialVersionUID = 1L;

	private String code = "-1";
	private String message = "系统异常";

	public BusinessException(String code, String message) {
		super();
		this.code = code;
		this.message = message;
	}

	public BusinessException(ErrorMessage message) {
		this.code = message.getCode();
		this.message = message.getMessage();
	}

	public BusinessException() {
		super();
		// TODO Auto-generated constructor stub
	}

	public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
		super(message, cause, enableSuppression, writableStackTrace);
		// TODO Auto-generated constructor stub
	}

	public BusinessException(String message, Throwable cause) {
		super(message, cause);
		// TODO Auto-generated constructor stub
	}

	public BusinessException(String message) {
		super(message);
		// TODO Auto-generated constructor stub
	}

	public BusinessException(Throwable cause) {
		super(cause);
		// TODO Auto-generated constructor stub
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

}
